<script setup lang="ts">
import { RouterView } from "vue-router";
</script>

<template>
  <div class="navbar">
    <router-link to="/">首页</router-link>
    <div class="dropdown">
      <button class="dropbtn">
        基本属性
        <i class="fa fa-caret-down"></i>
      </button>
      <div class="dropdown-content">
        <router-link to="/015_toRefs_toRef">015_toRefs_toRef</router-link>
        <router-link to="/016_Computed">016_Computed</router-link>
        <router-link to="/017_Watch">017_Watch</router-link>
        <router-link to="/018_Watch(情况二)">018_Watch(情况二)</router-link>
        <router-link to="/019_Watch(情况三)">019_Watch(情况三)</router-link>
        <router-link to="/异常处理">异常处理</router-link>
      </div>
    </div>
    <div class="dropdown">
      <button class="dropbtn">
        组件通讯
        <i class="fa fa-caret-down"></i>
      </button>
      <div class="dropdown-content">
        <router-link to="/Component_Communication/01_Props">01_Props</router-link>
        <router-link to="/Component_Communication/02_自定义事件">02_自定义事件</router-link>
        <router-link to="/Component_Communication/03_mitt">03_mitt</router-link>
        <router-link to="/Component_Communication/05_attrs">05_attrs</router-link>
        <router-link to="/Component_Communication/06_refs_parent">06_refs_parent</router-link>
      </div>
    </div>
    <router-link to="/About">测试</router-link>
    <router-link to="/About">关于</router-link>
  </div>
  <div class="Content">
    <RouterView />
  </div>
</template>

<style scoped>
.Content {
  margin-top: 10px;
  width: 99%;
  /* min-height: 600px; */
  min-height: 90vh;

  box-shadow: 0 0 20px #888;
  padding: 10px;
}

/* 主导航样式 */
.navbar {
  background-color: #333;
  overflow: hidden;
  border-radius: 8px;
}

.navbar a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 20px;
  text-decoration: none;
}

.navbar a:hover {
  background-color: #ddd;
  color: black;
}

/* 子菜单样式 */
.dropdown {
  float: left;
  overflow: hidden;
}

.dropdown .dropbtn {
  font-size: 16px;
  border: none;
  outline: none;
  color: white;
  padding: 14px 20px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

.navbar a:hover,
.dropdown:hover .dropbtn {
  background-color: #ddd;
  color: black;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.dropdown-content a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #ddd;
}

.dropdown:hover .dropdown-content {
  display: block;
}
</style>
